<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ include file="/WEB-INF/jsp/struts/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="style/home.css" type="text/css">
<script language=javascript src="script/prototype.js"></script>
<script language=javascript src="script/common.js"></script>
<STYLE TYPE="text/css">
#articleList {
border: 2px broove #eee;
margin-top: 1em;
}
#articleList a{
font-size:1em;
color:#330099
}

</STYLE>
<script language="Javascript">
function selectCategory() {
	var selobj = $('categoryID');
    var categoryID = selobj.options[selobj.selectedIndex].value;
	location.href="article.htm?method=list&categoryID=" + categoryID;
}

function submitForm(method) {
	location.href="article.htm?method=" + method;
}
</script>
</head>
<body>
<div id="content">
<div id="content_inner">
<BR><center>
<h2>我的笔记
<select name="categoryID" id="categoryID" onchange="selectCategory()">
<option value="0">-请选择-</option>
<c:forEach items="${categories}" var="entry">
    <OPTION VALUE="${entry.key}">${entry.value.description}
</c:forEach>
</select>
</h2>
</center>
<display:table htmlId="articleList" name="articleList" sort="list" 
     class="its" id="article" requestURI="article.htm">
<display:setProperty name="basic.empty.showtable" value="true" />
<display:setProperty name="basic.msg.empty_list_row" value="<tr class='empty'><td colspan='{0}'>没有记录</td></tr>"/>
<display:column title="标题" sortable="true" headerClass="sortable">
<img src="images/bullet.gif"/>
<INPUT TYPE="hidden" NAME="articleID" ID="articleID" value="${article.articleID}" >
<a href="article.htm?method=retrieve&articleID=${article.articleID}"
 title="${fn:escapeXml(article.content)}">
${article.topic}
</a>
</display:column>
<display:column property="keywords" title="关键字" sortable="true" headerClass="sortable"/>
<display:column title="类别" sortable="true" headerClass="sortable">
${categories[article.categoryID].description}
</display:column>
<display:column title="创建时间" sortable="true" headerClass="sortable" style="width:6em">
<fmt:formatDate value="${article.createTime}" pattern="MM/dd/yy HH:mm:ss"/>
</display:column>
<display:column title="<input type='button' onclick=\"submitForm('add')\" value='添加文章'/>" class="taskOperation" style="white-space:nowrap">
<a href="article.htm?method=edit&articleID=${article.articleID}&articleType=${param.articleType}" class="icon_btn pic_edit" title="Edit Task"><span>Edit Item</span></a>
<a href="article.htm?method=delete&articleID=${article.articleID}&articleType=${param.articleType}" class="icon_btn pic_delete" title="Delete Task"><span>Delete Item</span></a>
</display:column>
</display:table>
</div></div>
</body>
</html>